@extends('public.dashboard_base')
@section('title', '设置提现账户')

@section('content')
    <div class="control_panel_content">
        <div class="navBreadcrumb">
            <ul>
                <li>资金管理</li>
                <li><a href="/funds/withdrawal/setting">提现账户设置</a></li>
            </ul>
        </div>
        <div class="panel">
            <div class="sub_nav_container">
                <ul class="clearfix">
                    <li class="active"><a href="javascript:;">设置提现账户</a></li>
                    <li><a href="/funds/withdrawal">申请提现</a></li>
                    <li><a href="/funds/withdrawal/list">提现列表</a></li>
                </ul>
            </div>
            <div class="panel_body">
                <form class="layui-form">
                    {{csrf_field()}}
                    <ul class="form_group">
                        <li class="type_select">
                            <span class="form_label">收款方式</span>
                            <label>
                                <input type="radio" value="2" name="type" checked="" title="支付宝">
                            </label>
                        </li>
                        <li class="zfb_item">
                            <span class="form_label">支付宝姓名</span>
                            <input type="text" name="name">
                        </li>
                        <li class="zfb_item">
                            <span class="form_label">支付宝账号</span>
                            <input type="text" name="access">
                        </li>
                        {{--                        <li>--}}
                        {{--                            <span class="form_label"><span class="tips_box"><i class="iconfont iconwenhao text_light_gray" style="font-size: 14px;font-weight: 400"></i><span class="text" style="width:210px;white-space:normal">操作验证保障您的账户安全，可以在安全中心-&gt;<a href="/user/editsj" style="color: #2196F3">修改手机</a>中进行个性化设置。</span></span>&nbsp;手机号码</span>--}}
                        {{--                            <div style="width: 280px;display: inline-block;vertical-align: middle;height: 32px;line-height: 26px;">--}}
                        {{--                                <span style="vertical-align: middle">15166664603</span>--}}
                        {{--                                <input type="button" id="sms_send" class="btn btn_default fr" value="获取验证码">--}}
                        {{--                            </div>--}}
                        {{--                        </li>--}}
                        {{--                        <li>--}}
                        {{--                            <span class="form_label">验证码</span>--}}
                        {{--                            <input type="text" name="authCode" id="authCode">--}}
                        {{--                        </li>--}}
                        {{--                        <input type="hidden" name="msgType" id="msgType" value="WITHDRAW_BANK_SET">--}}
                        {{--                        <input type="hidden" name="protectType" id="protectType" value="WITHDRAW_ACCOUNT_SET">--}}
                        <li>
                            <span class="form_label"></span>
                            <button class="btn btn_primary" lay-submit lay-filter="submit">保存</button>
                            {{--                            <input type="button" onclick="history.go(-1)" class="btn btn_default" value="返回">--}}
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>
@endsection
@section('script')
    <script>
        $(function () {
            var link = $("#funds-withdrawal");
            link.parent().parent().parent().addClass("active");
            link.parent().addClass("active");
        });
        //监听提交
        layui.form.on('submit(submit)', function (data) {
            var submit = $(this);
            submit.attr('disabled', 'disabled');
            submit.addClass('layui-btn-disabled');
            $.ajax({
                url: "",
                type: "post",
                //dataType:"text",
                data: data.field,
                success: function (data) {
                    if (data.msg === 'success') {
                        layer.msg('成功', {icon: 1, time: 500}, function () {
                         //   window.location.reload(); //刷新页面
                            window.location.href="/funds/withdrawal" //指定路径
                          //  history.go(-1) //后退

                        })
                    } else {
                        layer.msg(data.msg, {icon: 2});
                        submit.removeAttr('disabled');
                        submit.removeClass('layui-btn-disabled');
                    }
                },
                error: function (xhr, Status, error) {
                    layer.msg(Status + ':' + xhr.responseJSON.data, {icon: 2});
                    submit.removeAttr('disabled');
                    submit.removeClass('layui-btn-disabled');
                }
            });
            return false;
        });
    </script>
@endsection
